<!--
 * @author guojiteng
 新建/编辑考试配置
 -->
<template>
  <div class="a-pass-manage">
    <div  class="a-pass-manage-title">
      <span v-if="pt==='g'">一键生成</span>
      <span v-else> 新建/编辑考试配置</span>
     </div>
    <section v-loading="loading" class="a-pass-manage-main">
      <el-form ref="form" :model="form" :rules="rules" label-width="150px" class="form">
        <el-form-item label="考试配置名称" prop="name" v-if="!pt">
          <el-input v-model="form.name" placeholder="请输入考试配置名称" />
        </el-form-item>
        <el-form-item label="导入模板" required v-if="pt==='g'">
          <div class="file-box">
            <el-upload
                ref="upload"
                :auto-upload="false"
                :on-success="uploadSuccess"
                :on-error="uploadError"
                :action="uploadaction"
                :headers="uploadHeaders"
                :data="uploadData"
                accept=".xls, .xlsx"
                class="upload-demo"
                drag
            >
              <i class="el-icon-upload" />
              <div class="el-upload__text">
                将文件拖到此处，或
                <em>点击上传</em>
              </div>
              <div slot="tip" class="el-upload__tip" style="text-align: right">
                只能上传.xls,.xlsx
                <el-button type="text" @click="handleDownload">下载模板</el-button>
              </div>
            </el-upload>
          </div>

        </el-form-item>
        <el-form-item label="考试配置数量" v-if="pt==='g'">
          <el-input v-model.number="form.num" oninput="value=value.replace(/[^0-9]/g,'')"  placeholder="请输入考试配置数量" />
        </el-form-item>
        <el-form-item label="题目分类" prop="extend1">
          <el-button v-if="!form.extend1" size="mini" @click="dialogPowerVisible=true" type="primary">选择分类</el-button>
          <el-tag
              v-else
              :closable="state==='create'"
              @close="handleClose()"
              type="primary">
            {{form.extend2}}
          </el-tag>
        </el-form-item>
        <el-form-item v-if="!pt" label="题目难度类型" prop="difficultyCategory">
          <el-radio-group v-model="form.difficultyCategory">
            <el-radio :label="0">随机 </el-radio>
            <el-radio :label="1">固定</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="出题数量" prop="quesNums">
          <el-input v-model.number="form.quesNums" :disabled="state!=='create'" oninput="value=value.replace(/[^0-9]/g,'')"  placeholder="请输入出题数量" />
        </el-form-item>
        <el-form-item label="每题分值" prop="perQuesFraction">
          <el-input v-model.number="form.perQuesFraction" oninput="value=value.replace(/[^0-9]/g,'')"  placeholder="请输入每题分值" />
        </el-form-item>
        <el-form-item label="答题错误分值" prop="wrongAnswersFraction">
          <el-input v-model.number="form.wrongAnswersFraction" oninput="value=value.replace(/[^0-9]/g,'')"  placeholder="请输入答题错误分值" />
        </el-form-item>
        <el-form-item label="过关条件" prop="clearanceConditions">
          <el-radio-group v-model="form.clearanceConditions">
            <el-radio :label="1">分数</el-radio>
            <el-radio :label="2">正确率</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="过关具体值" prop="clearanceConditionsValue">
          <el-input v-model.number="form.clearanceConditionsValue" oninput="value=value.replace(/[^0-9]/g,'')"  placeholder="请输入过关具体值" />
        </el-form-item>
        <el-form-item label="重复考试类别" prop="repeatPass">
          <el-radio-group v-model="form.repeatPass">
            <el-radio :label="0">不限次数</el-radio>
            <el-radio :label="1">自定义每日重复考试次数</el-radio>
            <el-radio :label="2">不可重复考试</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-if="form.repeatPass===1" label="考试次数" prop="repeatedNum">
          <el-input v-model.number="form.repeatedNum" oninput="value=value.replace(/[^0-9]/g,'')"  placeholder="请输入考试次数" />
        </el-form-item>
        <el-form-item label="考试配置时限（秒）" prop="limitTime">
          <el-input v-model.number="form.limitTime" placeholder="请输入考试配置时限(秒)" />
        </el-form-item>
      </el-form>
    </section>

    <section class="a-pass-manage-footer">
      <el-button style="padding: 10px 30px;" @click="onCancel">取 消</el-button>
      <el-button type="primary" @click="onSubmint('form')">确 定</el-button>
    </section>
    <!--选择题库  -->
    <el-dialog custom-class="my-dialog" v-el-drag-dialog title="选择题库分类" :visible.sync="dialogPowerVisible" center width="450px" :close-on-click-modal="false">
      <choose-qs ref="PowerTreeFun" v-if="dialogPowerVisible"  :is-selsct="true"  @subQs="getQsFun"  @dialogPower="dialogPower" />
      <div slot="footer" class="dialog-footer">
        <el-button style="padding: 8px 30px;" @click="dialogPowerVisible = false">取消</el-button>
        <el-button style="padding: 8px 30px;" type="primary" @click="powerTreeFun">确定</el-button>
      </div>
    </el-dialog>
    <!--选择模板-->
    <el-dialog v-el-drag-dialog :close-on-click-modal="false" v-show="dialogUploadVisible"  :visible.sync="dialogUploadVisible" title="导入考试配置" center width="500px" @close="handleClosed">
      <el-upload
          ref="upload"
          :auto-upload="false"
          :on-success="uploadSuccess"
          :on-error="uploadError"
          :action="uploadaction"
          :headers="uploadHeaders"
          :data="uploadData"
          accept=".xls, .xlsx"
          class="upload-demo"
          drag
      >
        <i class="el-icon-upload" />
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div slot="tip" class="el-upload__tip" style="text-align: right">
          只能上传.xls,.xlsx
          <el-button type="text" @click="handleDownload">下载模板</el-button>
        </div>
      </el-upload>
      <span slot="footer" class="dialog-footer">
        <el-button style="padding: 8px 30px;" type="primary" @click="handleClosed">取消</el-button>
        <el-button style="padding: 8px 30px;" type="primary" @click="submitUpload()">确认</el-button>
      </span>
    </el-dialog>
    <!-- 导入的错误信息  -->
    <el-dialog v-el-drag-dialog :close-on-click-modal="false" :visible.sync="dialogUploadErrorTextVisible" title="错误信息" center width="500px">
      <div class="error-text" style="height: 600px;overflow-y: auto">
        <el-row>
          <el-col v-for="(item, index) in uploadErrorList" :key="index" :span="24" style="margin-bottom: 10px;">{{ index + 1 }}、{{ item }}</el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button style="padding: 8px 30px;" type="primary" @click="dialogUploadErrorTextVisible = false">关闭</el-button>
        <el-button style="padding: 8px 30px;" type="primary" @click="copyErrorText()">复制</el-button>
      </span>
    </el-dialog>    <!-- 导入的错误信息  -->
    <!--考试配置列表预览-->
    <el-dialog v-el-drag-dialog :close-on-click-modal="false" :visible.sync="dialogTableVisible" title="错误信息" center width="1300px">
      <div class="pass-box">
        <p>
          总题数：<span style="color:red;">{{passObj.totalQuesNum||'0'}}</span>&nbsp;&nbsp;&nbsp;&nbsp;
          需要题数：<span style="color:red;">{{passObj.needQuesNum||'0'}}</span>&nbsp;&nbsp;&nbsp;&nbsp;
          考试配置数：<span style="color:red;">{{passObj.num||'0'}}</span>&nbsp;&nbsp;&nbsp;&nbsp;
        </p>
        <el-table
            height="560"
            :data="passData"
            border
            style="width: 100%">
          <el-table-column
              align="center"
              width="80"
              prop="num"
              label="考试配置序号">
          </el-table-column>
          <el-table-column
              label="出题数量">
            <template slot-scope="scope">
              <el-input v-model="scope.row.quesNums" oninput="value=value.replace(/[^0-9]/g,'')" placeholder="请输入"></el-input>
            </template>
          </el-table-column>
          <el-table-column
              label="每题分值">
            <template slot-scope="scope">
              <el-input v-model="scope.row.perQuesFraction" oninput="value=value.replace(/[^0-9]/g,'')" placeholder="请输入"></el-input>
            </template>
          </el-table-column>
          <el-table-column
              label="答错分值">
            <template slot-scope="scope">
              <el-input v-model="scope.row.wrongAnswersFraction" oninput="value=value.replace(/[^0-9]/g,'')" placeholder="请输入"></el-input>
            </template>
          </el-table-column>
          <el-table-column
              label="答题时间（秒）">
            <template slot-scope="scope">
              <el-input v-model="scope.row.limitTime" oninput="value=value.replace(/[^0-9]/g,'')" placeholder="请输入"></el-input>
            </template>
          </el-table-column>
          <el-table-column
              label="过关条件">
            <template slot-scope="scope">
              <el-radio-group v-model="scope.row.clearanceConditions">
                <el-radio :label="1">分数</el-radio>
                <el-radio style="margin-top: 20px;" :label="2">正确率</el-radio>
              </el-radio-group>
            </template>
          </el-table-column>
          <el-table-column
              label="过关具体值">
            <template slot-scope="scope">
              <el-input v-model="scope.row.clearanceConditionsValue" oninput="value=value.replace(/[^0-9]/g,'')" placeholder="请输入"></el-input>
            </template>
          </el-table-column>
          <el-table-column
              label="重复考试类别">
            <template slot-scope="scope">
              <el-radio-group v-model="scope.row.repeatPass">
                <el-radio :label="0">不限次数</el-radio>
                <el-radio style="margin-top: 20px;"  :label="1">自定义每日重复考试次数</el-radio>
                <el-radio style="margin-top: 20px;"  :label="2">不可重复考试</el-radio>
              </el-radio-group>
            </template>
          </el-table-column>
          <el-table-column
              label="重复答题次数">
            <template slot-scope="scope">
              <el-input  v-if="scope.row.repeatPass===1" v-model="scope.row.repeatedNum" oninput="value=value.replace(/[^0-9]/g,'')" placeholder="请输入"></el-input>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button style="padding: 8px 30px;" type="primary" @click="dialogTableVisible = false">关闭</el-button>
        <el-button style="padding: 8px 30px;" type="primary" @click="generateFun()">生成</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { specialText } from '@/utils/validate'
import { mapGetters } from 'vuex'
import ImageUpload from '@/components/ImageUpload'
import ChooseQs from '@/views/skill/answerRush/components/chooseQs'
import elDragDialog from '@/directive/el-drag-dialog'
import {
  insert,
  update,
  get,
  generate
} from './../api/pass'
import {exportSign, importSign} from "@/utils/fileImportOrExportSign";
export default {
  name: 'PassManage',
  components: { ImageUpload,ChooseQs },
  directives: { elDragDialog },
  data() {
    return {
      dialogTableVisible:false,
      dialogPowerVisible:false,
      dom:'',
      qsName:[],
      qsId:[],
      options:[],//考试策略模板
      loading: false,
      form: {
        id: '',
        dataId:'',
        name: '',
        num:'',
        difficultyCategory:0,
        quesNums:'',
        perQuesFraction:'',
        wrongAnswersFraction:'',
        clearanceConditions:1,
        clearanceConditionsValue:'',
        repeatPass:0,
        repeatedNum:'',
        extend1:'',
        extend2:'',
        limitTime:''
      },
      rules: {
        name: [
          { required: true, message: '请输入考试配置名称', trigger: 'blur' },
          { validator: specialText, trigger: 'blur' },
          { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
        ],
        difficultyCategory: [
          { required: true, message: '请选择题目难度类型', trigger: 'change' }
        ],
        num: [
          { required: true, message: '请输入考试配置数量', trigger: 'blur' }
        ],
        quesNums: [
          { required: true, message: '请输入出题数量', trigger: 'blur' }
        ],
        perQuesFraction: [
          { required: true, message: '请输入每题分值', trigger: 'blur' }
        ],
        wrongAnswersFraction: [
          { required: true, message: '请输入答题错误分值', trigger: 'blur' }
        ],
        clearanceConditions: [
          { required: true, message: '请选择过关条件', trigger: 'change' }
        ],
        clearanceConditionsValue: [
          { required: true, message: '请输入过关具体值', trigger: 'blur' }
        ],
        repeatPass: [
          { required: true, message: '请选择重复考试类别', trigger: 'change' }
        ],
        repeatedNum: [
          { required: true, message: '请输入考试次数', trigger: 'blur' }
        ],
        extend1: [
          { required: true, message: '请选择题库分类', trigger: 'change' }
        ],
        limitTime: [
          { required: true, message: '请输入考试配置时限', trigger: 'blur' }
        ]
      },
      state: 'create',
      t: '0',
      type: 1,
      pt:'', //页面类型，如果值为g时，代表为一键生成
      fileName:'',
      dialogUploadVisible:false,
      uploadData: {
        dataId: ''
      },
      uploadaction: '/API-ENTERPRISE-BACKEND/backend/rushPass/previewBuild',
      uploadHeaders: { ttsxbwqm: '', ttsxsjzc: '', ttsxyhcs: '' },
      dialogUploadErrorTextVisible:false,
      uploadErrorList: [],
      uploadLoding:'',
      passObj:'',
      passData:[],//预览考试配置数据
    }
  }
  ,
  computed: {
    ...mapGetters([
      'user'
    ])
  },
  watch: {
    'form.classifyId': {
      handler(newName, oldName) {
        if (this.$refs.classify) {
          this.$refs.classify.dropDownVisible = false
        }
      },
      immediate: true,
      deep: true
    }
  },
  created() {
    this.state = this.$route.query.type === 'c' ? 'create' : 'update'
    this.pt=this.$route.query.pt||''
    if (this.$route.query.type === 'u') {
      if (this.$route.query.ui) {
        this.getData(this.$route.query.ui)
      } else {
        this.$message({
          showClose: true,
          message: '参数异常！',
          type: 'warning',
          onClose: () => {
            this.$router.back()
          }
        })
      }
    }else{
      if(this.$route.query.i){
        this.form.dataId=this.$route.query.i
      }
    }
  },

  methods: {
    /**
     * 生成考试配置
     */
    generateFun() {
      const loading = this.$loading({
        lock: true,
        text: '请稍后',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.3)'
      })
      return new Promise((resolve, reject) => {
        generate({ uuid: this.passObj.uuid,rushPassList:JSON.stringify(this.passData) }).then(res => {
          loading.close()
          if (res.data.code==='200'){
            this.$message.success('考试配置生成成功')
            this.onCancel()
          }
        }).catch(error => {
          loading.close()
          reject(error)
        })
      })
    },
    /**
     * 复制错误消息
     */
    copyErrorText() {
      let val = ''
      this.uploadErrorList.forEach(item => {
        val += item + '\n'
      })
      const input = document.createElement('input')
      input.setAttribute('readonly', 'readonly')
      input.setAttribute('value', val)
      document.body.appendChild(input)
      input.select()
      if (document.execCommand('copy')) {
        document.execCommand('copy')
        this.$message({
          title: '成功',
          message: '复制成功！',
          type: 'success',
          duration: 1500
        })
      }
      document.body.removeChild(input)
    },
    /**
     * 预览模板
     * */
    handleUpload(){
      this.uploadHeaders = importSign({}, this.form)
      this.uploadData=this.form
      this.uploadLoding=this.$loading({
        lock: true,
        text: '请稍后',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.3)'
      })
      setTimeout(() => {
        this.$nextTick(()=>{
          console.log('lo', this.$refs.upload)
          this.$refs.upload.submit()
        })
      }, 1000)
    },
    submitUpload() {
      if (this.$refs['upload'].uploadFiles.length === 0) {
        this.$message.error('请上传文件')
      } else {
        console.log('file',this.$refs['upload'].uploadFiles[0])
        this.fileName=this.$refs['upload'].uploadFiles[0].name
        this.dialogUploadVisible=false
      }
    },
    /**
     * 更换模板
     * */
    handleFileClose(){
      this.fileName=''
      this.$refs.upload.clearFiles()
    },
    handleDownload() {
      const link = document.createElement('a')
      link.style.display = 'none'
      link.href = '/API-ENTERPRISE-BACKEND/backend/rushPass/downloadPassTemplate' + exportSign({ type: '1' }).paramStr
      link.setAttribute('download', '考试配置模版.xlsx')
      link.setAttribute('target', '_blank')
      document.body.appendChild(link)
      link.click()
      document.body.removeChild(link)
    },

    uploadSuccess(data) {
      this.uploadLoding.close()
      if (data.code === '200') {
        this.$message({
          message: '成功',
          type: 'success'
        })
        this.dialogUploadVisible = false
        this.$refs.upload.clearFiles()
        this.passObj=data.data || ''
        this.passData=data.data.list || []
        this.dialogTableVisible=true
      } else {
        this.$message.error(data.msg || '网络异常')
        if (data.data.fileid) {
          const link = document.createElement('a')
          link.style.display = 'none'
          link.href = '/API-ENTERPRISE-BACKEND/backend/rushPass/downloadCheckFile' + exportSign({ errorId: data.data.fileid }).paramStr
          link.setAttribute('download', '考试配置错误模版.xlsx')
          link.setAttribute('target', '_blank')
          document.body.appendChild(link)
          link.click()
          document.body.removeChild(link)
        }
        this.$refs.upload.clearFiles()
        if (data.data) {
          this.uploadErrorList = data.data
          this.dialogUploadErrorTextVisible = true
        }
      }
    },
    uploadError(err) {
      this.uploadLoding.close()
      this.$message.error(err || '网络异常')
    },
    handleClosed() {
      this.dialogUploadVisible = false
      this.$refs.upload.clearFiles()
    },
    /**
     * 去掉某个题库
     * */
    handleClose(){
      this.form.extend1=''
      this.form.extend2=''
    },
    /**
     * 题库
     */
    getQsFun(obj){
      this.form.extend2=obj.menuName
      this.form.extend1=obj.menuIds
      this.$refs['form'].validateField('extend1',(val)=>{
        if (!val) {
          return true;
        } else {
          return false;
        }
      })
    },
    /**
     * 关闭权限弹框
     */
    dialogPower(val) {
      this.dialogPowerVisible = val
    },
    /**
     * 确认题库
     */
    powerTreeFun(){
      this.$refs.PowerTreeFun.saveData()
      this.dialogPowerVisible=false
    },


    /**
     * 根编辑回显
     */
    getData(id) {
      const loading = this.$loading({
        lock: true,
        text: '请稍后',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.3)'
      })
      return new Promise((resolve, reject) => {
        get({ id: id }).then(res => {
          loading.close()
          const data = res.data.data
          for (const key in this.form) {
            this.form[key] = data[key]
          }
        }).catch(error => {
          loading.close()
          reject(error)
        })
      })
    },

    /**
     * 取消考试维护
     */
    onCancel() {
      // this.$router.push({ path: this.$filterPath('index'), query: { t: this.t }})
      this.$router.back()
    },

    /**
     * 发布考试
     */
    onSubmint() {
      if (this.state === 'create') {
        this.$refs['form'].validate((valid) => {
          if (valid) {
            if(this.pt==='g'){
              if (this.$refs['upload'].uploadFiles.length === 0) {
                this.$message.error('请上传文件')
                return
              } else {
                console.log('file',this.$refs['upload'].uploadFiles[0])
                this.fileName=this.$refs['upload'].uploadFiles[0].name
                this.dialogUploadVisible=false
              }
              this.handleUpload()
              return
            }
            const loading = this.$loading({
              lock: true,
              text: '请稍后',
              spinner: 'el-icon-loading',
              background: 'rgba(0, 0, 0, 0.3)'
            })
            return new Promise((resolve, reject) => {
              insert(this.form).then(() => {
                this.dialogVisible = false
                loading.close()
                this.$message({
                  title: '成功',
                  message: '创建成功',
                  type: 'success',
                  duration: 2000
                })
                this.onCancel()
              }).catch(error => {
                reject(error)
                loading.close()
              })
            })
          } else {
            console.log('error submit!!')
            return false
          }
        })
      } else {
        this.$refs['form'].validate((valid) => {
          if (valid) {
            const loading = this.$loading({
              lock: true,
              text: '请稍后',
              spinner: 'el-icon-loading',
              background: 'rgba(0, 0, 0, 0.3)'
            })
            return new Promise((resolve, reject) => {
              update(this.form).then(() => {
                this.dialogVisible = false
                loading.close()
                this.$message({
                  title: '成功',
                  message: '编辑成功',
                  type: 'success',
                  duration: 2000
                })
               this.onCancel()
              }).catch(error => {
                reject(error)
                loading.close()
              })
            })
          } else {
            return false
          }
        })
      }
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss">
.a-pass-manage {
  background-color: #fff;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  overflow: hidden;
  .el-radio{
    margin-top: 12px;
  }
  .file-box{
    width: 300px;
  }
  .upload-demo{
    .el-upload-dragger{
      width: 100%;
    }
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .a-pass-manage-title {
    position: relative;
    height: 40px;
    line-height: 40px;
    padding: 0 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    font-family: PingFangSC-Medium;
    font-weight: bold;
    color: rgba(51, 51, 51, 1);
    font-size: 14px;
    &:before {
      content: '';
      position: absolute;
      width: 2px;
      @include bg-color($mainColor);
      top: 13px;
      bottom: 13px;
      left: 15px;
    }
  }

  .a-pass-manage-main {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 52px;
    box-sizing: border-box;
    padding: 0 10px;
    overflow: hidden;
    &::-webkit-scrollbar {
      width: 8px; /*对垂直流动条有效*/
      height: 1px; /*对水平流动条有效*/
    }
    /** 滚动条轨道*/
    &::-webkit-scrollbar-track {
      box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
      background-color: white;
      border-radius: 3px;
    }
    /** 滚动条里面小方块*/
    &::-webkit-scrollbar-thumb {
      height: 32px;
      border-radius: 5px;
      box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
      background-color: #eaeaea;
    }
    &:hover {
      overflow: auto;
    }
    .form {
      width: 1000px !important;
      margin: 0 auto;
      .el-select {
        width: 100%;
      }

      .line {
        text-align: center;
      }
    }
    .select-data {
      display: inline-block;
      background: rgba(246, 246, 246, 1);
      border-radius: 4px;
      font-size: 14px;
      font-family: PingFangSC-Regular;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
      padding: 0 10px;
      margin-right: 5px;
      margin-bottom: 8px;
      i {
        cursor: pointer;
        padding-left: 5px;
      }
    }
    .selectbtn {
      display: inline-block;
      width: 120px;
      background: rgba(255, 255, 255, 1);
      @include border-color(1px, dotted, $mainColor);
      border-radius: 4px;
      font-size: 14px;
      font-family: PingFangSC-Regular;
      font-weight: 400;
      @include font-color($mainColor);
      text-align: center;
      cursor: pointer;
    }
  }

  .a-pass-manage-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    padding: 10px 0;
    background-color: white;
    box-shadow: 0 -3px 6px #f5f5f5;
  }
}
</style>
<style lang="scss">
.a-pass-manage {
  .classify-tree-con {
    position: relative;
    height: 400px;
    overflow: hidden;
    .classify-tree-con-scrollbar {
      overflow: hidden;
      .el-scrollbar__wrap {
        max-height: 381px;
      }
    }
    .custom-tree-node {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 14px;
      width: 100%;
      .tree-node-txt {
        flex: 1;
      }
    }
  }
}
</style>

